package com.lwl.controller;

import com.lwl.entity.LayData;
import com.lwl.service.TMenuRoleService;
import org.springframework.web.bind.annotation.*;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * (TMenuRole)表控制层
 *
 * @author Lei
 * @since 2022-10-26 16:20:02
 */
@RestController
@RequestMapping("tMenuRole")
public class TMenuRoleController {
    /**
     * 服务对象
     */
    @Autowired
    private TMenuRoleService tMenuRoleService;

    /**
     *  在联合菜单中根据角色的id对角色权限进行赋值，赋值角色权限时，要先删除原有的权限，再添加新的权限
     * @return
     */
    @PostMapping("updRoleMenu")
    public LayData updRoleMenu(Integer rid,String mids){
        System.out.println("开始给角色权限赋值");
        return new LayData(tMenuRoleService.updRoleMenu(rid,mids));
    }

}
